The present invention relates to a disk control unit for writing and reading data to/from a disk apparatus having a data format of a variable length on the basis of an input/output request of an upper apparatus and, more particularly, to a disk control unit for holding data in a cache memory on a track unit basis, thereby promptly coping with an access from the upper apparatus.
In recent years, in a magnetic disk subsystem which is used for an external storage of a computer system, it is indispensable to use a cache technique in a disk control unit to which a plurality of magnetic disk units are connected as physical devices under the domination of the disk control unit. Such a cache function of the disk control unit is known as a disk cache. In association with an access of a large quantity of data, there have been proposed various methods such as increase in capacity of the cache memory, formation of a non-volatile cache memory in order to guarantee the holding of data when a power supply is shut off, and the like. Among them, an attention is paid to a technique such that data of a disk unit is held in the cache memory on a track unit basis, a staging process of the data from the disk unit to the cache memory is not used as a prerequisite, and even if the cache memory causes a mishit due to a writing process, and the data from a host computer is stored into the cache memory and input/output processes are finished without needing an access to the disk unit, thereby enabling an input/output processing time to be reduced. Such a function in which all of the processes until the end of the input and output are finished on the cache memory by holding the data in the cache memory on a track unit basis largely contributes to reduce an executing time in case of performing processes such as formation, updating, and working of a work data set on the disk unit.
As for a cache control in which a data management on the cache memory is performed on a track unit basis of a disk unit, in a magnetic disk subsystem for storing data into the disk unit as a block of a fixed length, since a recording format of the disk unit has fixedly been determined, a record management of the track unit can be relatively easily realized on the cache memory. However, in a subsystem using a disk unit of a CKD format to store data of a variable length, since the number of records of each track is variable and the data can be formatted on a track unit basis, there is also a possibility such that recording formats on the cache and the disk differ. If the input/output processes are finished on the cache memory without confirming the recording format of the disk unit, there are various problems. For example, although the input/output processes are executed by a one-sided instruction of a host computer, there is often a mistake in recognition of an input/output processing software, so that there is a situation such that a record of a format different from the recording format on the disk unit is written. Such a difference between the recording formats of the input/output processing software and the disk unit occurs due to an error that is caused by a bug of the input/output processing software. In addition to such an error, however, there is also a case where the input/output processing software purposely changes the last recording format, thereby abnormally finishing.
For such a difference of the recording formats, hitherto, since the disk unit is accessed and data is written while confirming a data length and the like of the record, a process can be refused for those mistakes. However, in the cache control such that the end of the input/output process is notified to the host computer at a time point when the write data to the record has been written into the cache memory, there occurs a problem such that even if the recording format of the disk unit differs from the recording format written into the cache memory, such a fact cannot be recognized and a failure of the processes cannot be reported. As another example, in a reading or searching process of the disk unit, since data has an uncertain length, unless the records of the track are sequentially read out, it is impossible to access to a target track, and the processes on the cache memory cannot be finished.